package d0327;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

public class Test {
    public static void main(String[] args) {
        String[] keywords ={
                "Offline","installation ","requires"," you", "to ","download","an ","executable"," file"," available"," at"," the"," manual"," Java","download",
               " page", "which ","includes"," all"," the"," files"," needed"," for ","the"," complete","installation ","at"," the"," user","s ","discretion.",
        "There"," is"," no"," need","to", "remain","connected"," to ","the"," Internet"," during ","the ","installation"
        };
        int[] keywordsnum = new int[keywords.length];
        try {
            File file = new File("src/d0327/Offline.txt");
            //file.mkdir();
            //    File file1 = new File("D:/a.txt/Test");
            FileReader fr = new FileReader(file);
            BufferedReader br = new BufferedReader(fr);
            String[] values = br.readLine().split(" ");
            for (String str : values) {
                for (int i = 0;i < keywords.length;i++) {
                    if(str.equals(keywords[i])) {
                        keywordsnum[i]++;
                    }
                }
            }
            for(int i = 0; i < keywordsnum.length;i++) {
                if(keywordsnum[i] != 0) {
                    System.out.println(keywords[i]+" "+keywordsnum[i]);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }


}

